home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / FPSE_src / system / amiga / plugin / joy / joy.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-01  |  1.3 KB  |  75 lines

  1. #include "fpse.h"
  2.  
  3. extern int joy0_ret;
  4. extern int joy1_ret;
  5.  
  6. static char *padbuf0 = NULL;
  7. static char *padbuf1 = NULL;
  8.  
  9. // This Function is called when emulator starts
  10. int JOY0_Open(UINT32 *joy)
  11. {
  12.   // Nothing to do here
  13.   return FPSE_OK;
  14. }
  15.  
  16. // This Function is called when emulator is closed
  17. void JOY0_Close()
  18. {
  19.   // Nothing to do here
  20. }
  21.  
  22. // This function is called when the gamepad should vibrate:
  23. // if (motor != 0) then vibrate(on) else vibrate(off)
  24. void JOY0_Vibrate(int motor)
  25. {
  26. }
  27.  
  28. // Return status of buttons (see joydrv.h)
  29. void JOY0_Poll()
  30. {
  31.   padbuf0[3] = joy0_ret >> 8;
  32.   padbuf0[4] = joy0_ret;
  33. }
  34.  
  35. int JOY0_InitHeader(char *buf)
  36. {
  37.   padbuf0 = buf;
  38.   buf[1] = 0x41;
  39.   buf[2] = 0x5A;
  40.   return 5;
  41. }
  42.  
  43. // This Function is called when emulator starts
  44. int JOY1_Open(UINT32 *joy)
  45. {
  46.   // Nothing to do here
  47.   return FPSE_OK;
  48. }
  49.  
  50. // This Function is called when emulator is closed
  51. void JOY1_Close()
  52. {
  53.   // Nothing to do here
  54. }
  55.  
  56. // This function is called when the gamepad should vibrate:
  57. // if (motor != 0) then vibrate(on) else vibrate(off)
  58. void JOY1_Vibrate(int motor)
  59. {
  60. }
  61.  
  62. // Return status of buttons (see joydrv.h)
  63. void JOY1_Poll()
  64. {
  65.   padbuf1[3] = joy1_ret >> 8;
  66.   padbuf1[4] = joy1_ret;
  67. }
  68.  
  69. int JOY1_InitHeader(char *buf)
  70. {
  71.   padbuf1 = buf;
  72.   buf[1] = 0x41;
  73.   buf[2] = 0x5A;
  74.   return 5;
  75. }